<?php

namespace App\Providers;

use App\Models\Company;
use App\Models\Inspection;
use App\Models\User;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Relations\Relation;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
		/**
		 * 自定义多态关联类型关键字
		 *
		 * Date: 19/03/2018
		 * @author George
		 * @see https://laravel.com/docs/5.6/eloquent-relationships#polymorphic-relations
		 */
    	Relation::morphMap([
    		'user' => User::class,
    		'company' => Company::class,
			'inspection' => Inspection::class
		]);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
